package com.ruoyi.system.service.impl.biz;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.biz.BmMemberMapper;
import com.ruoyi.system.domain.biz.BmMember;
import com.ruoyi.system.service.biz.IBmMemberService;
import com.ruoyi.common.core.text.Convert;

/**
 * 会员Service业务层处理
 * 
 * @author xiangzhipeng
 * @date 2022-11-25
 */
@Service
public class BmMemberServiceImpl implements IBmMemberService 
{
    @Autowired
    private BmMemberMapper bmMemberMapper;

    /**
     * 查询会员
     * 
     * @param id 会员主键
     * @return 会员
     */
    @Override
    public BmMember selectBmMemberById(String id)
    {
        return bmMemberMapper.selectBmMemberById(id);
    }

    /**
     * 查询会员列表
     * 
     * @param bmMember 会员
     * @return 会员
     */
    @Override
    public List<BmMember> selectBmMemberList(BmMember bmMember)
    {
        return bmMemberMapper.selectBmMemberList(bmMember);
    }

    /**
     * 新增会员
     * 
     * @param bmMember 会员
     * @return 结果
     */
    @Override
    public int insertBmMember(BmMember bmMember)
    {
        bmMember.setCreateTime(DateUtils.getNowDate());
        return bmMemberMapper.insertBmMember(bmMember);
    }

    /**
     * 修改会员
     * 
     * @param bmMember 会员
     * @return 结果
     */
    @Override
    public int updateBmMember(BmMember bmMember)
    {
        bmMember.setUpdateTime(DateUtils.getNowDate());
        return bmMemberMapper.updateBmMember(bmMember);
    }

    /**
     * 批量删除会员
     * 
     * @param ids 需要删除的会员主键
     * @return 结果
     */
    @Override
    public int deleteBmMemberByIds(String ids)
    {
        return bmMemberMapper.deleteBmMemberByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除会员信息
     * 
     * @param id 会员主键
     * @return 结果
     */
    @Override
    public int deleteBmMemberById(String id)
    {
        return bmMemberMapper.deleteBmMemberById(id);
    }

    @Override
    public List<BmMember> selectAllBmMember() {
        return bmMemberMapper.selectAllBmMember();
    }
}
